'''
Desc: 创建旗帜僵尸对象
Author: 陈爱国
Date: 2024-08-24 10:49:49
'''
import pygame
import random
from Zombie import Zombie

class FlagZombie(Zombie):
    def __init__(self):
        # 调用父类构造方法
        super(FlagZombie, self).__init__()
        # 图片
        self.image = pygame.image.load('material/images/FlagZombie_0.png').convert_alpha()
        # 图片序列，用于产生动画
        self.images = [pygame.image.load('material/images/FlagZombie_{}.png'.format(i)).convert_alpha() for i in range(12)]
        # 图片的矩形区域
        # self.rect = self.images[0].get_rect()
        # 图片top
        # self.rect.top = 25 + random.randrange(0, 4) * 125
        # 图片left
        # self.rect.left = 1000
        # 速度
        self.speed = 4
        # 能量
        self.energy = 10

    # def update(self, *args):
    #     # 更新图片
    #     self.image = self.images[args[0] % len(self.images)]

    #     if self.energy>0:
    #         # 更新位置
    #         if self.rect.left > 250:
    #             self.rect.left -= self.speed
    #     else:
    #         # 销毁
    #         self.kill()